<template>
    <ul class="todo-list">
        <!-- completed: 完成的类名 -->
        <li v-for="(item,index) in show" :key="index" :class="{'completed':item.isDone}"  >
        <div class="view">
            <input class="toggle" type="checkbox" v-model="item.isDone" />
            <label>{{item.name}}</label>
            <button @click="removeFn(index)" class="destroy"></button>
        </div>
        </li>
    </ul>
</template>

<script>
export default {
    props:["list"],
    data(){
        return{
            // // falg:this.list[this.index].isDone,
            // index1:this.index
        }
    },
    methods:{
        removeFn(val){
            this.$emit('remove',val)
        }
    }
    
}
</script>